home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / cp4_2_1.lha / cp4_NOTREG / bin / postnews < prev    next >
Text File  |  1995-04-08  |  1KB  |  53 lines

  1. /*
  2. ** Postnews Replacement Script
  3. ** GRn Can Now Post News :-)
  4. */
  5.  
  6. Parse arg result
  7. a = 0
  8. art = word(result,1)
  9. art2 = word(result,3)
  10. alreadyinsertedfile = "FALSE"
  11. if art2 ~="" then
  12. do
  13.   call open(file,art,"A")
  14.   call seek(file,0,"B")
  15.   do while ~eof(file)
  16.     a = a + 1
  17.     line.a = readln(file)
  18.     say line.a
  19.     if upper(word(line.a,1)) == "FROM:" then a = a - 1
  20.     if upper(word(line.a,1)) == "SUBJECT:" then
  21.     do
  22.       Subject = delword(line.a,1,1)
  23.       say subject
  24.       a = a -1
  25.     end
  26.     if alreadyinsertedfile == "FALSE" then call insertfile2()
  27.   end
  28.   call close(file)
  29.   art = "t:grn-file"
  30.   call open(file,art,"W")
  31.   call seek(file,0,"B")
  32.   do i = 1 to a
  33.      call writeln(file,line.i)
  34.   end
  35.   call close(file)
  36. end
  37.  
  38. if a == 0 then address command "amitcp:bin/sendmail <" art "-f $USER -t mail2news@$NEWSSERVER"
  39. if a ~== 0 then address command "amitcp:bin/sendmail <" art "-f $user -t mail2news@$newsserver -s "subject
  40. exit
  41.  
  42. insertfile2:
  43.   say "insertfile4real"
  44.   call open(file2,art2,"R")
  45.   do while ~eof(file2)
  46.     a = a + 1
  47.     line.a = readln(file2)
  48.     if word(line.a,1) == "X-NewsSoftware:" then line.a = "X-NewsSoftware: GRn 2.1 19/2/94 (PostNews Fix 31/3/95 Martin Hunt)"
  49.   end
  50.   alreadyinsertedfile = "TRUE"
  51.   call close(file2)
  52. RETURN
  53.